package com.fuershiye.woman.monitor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fuershiye.woman.monitor.dao.BulletinReadDao;
import com.fuershiye.woman.monitor.model.BulletinRead;
import com.fuershiye.woman.monitor.service.BulletinReadService;

@Service("bulletinReadService")
public class BulletinReadServiceImpl implements BulletinReadService {

	@Autowired
	private BulletinReadDao itDao;

	@Override
	public void save(BulletinRead it) {
		itDao.save(it);
	}

	@Override
	public void delete(Long id) {
		itDao.delete(id);
	}

	@Override
	public BulletinRead get(Long id) {
		return itDao.get(id);
	}
	
	@Override
	public BulletinRead getByBidUid(Long bid, Long uid) {
		List<BulletinRead> result = itDao.getByBidUid(bid, uid);
		if(result!=null && !result.isEmpty()){
			return result.get(0);
		}
		return null;
	}

	@Override
	public List<BulletinRead> getByUid(Long uid) {
		return itDao.getByUid(uid);
	}
	
	@Override
	public List<Long> getAllBidByUid(Long uid) {
		return itDao.getAllBidByUid(uid);
	}

}
